package 题目集.前缀和.差分;

import java.io.*;
import java.util.function.Consumer;

//https://vjudge.net.cn/contest/612024#problem/A
public class 地毯 {
    static int n;
    static int m;
    static int[][] arr;

    public static void main(String[] args) {
        Reader sc = new Reader();
        invoke(pw -> {
            n = sc.nextInt();
            m = sc.nextInt();
            arr = new int[n + 2][n + 2];
            for (int i = 0; i < m; i++) {
                int x1 = sc.nextInt();
                int y1 = sc.nextInt();
                int x2 = sc.nextInt();
                int y2 = sc.nextInt();
                arr[x1][y1] = arr[x1][y1] + 1;
                arr[x2 + 1][y1] = arr[x2 + 1][y1] - 1;
                arr[x1][y2 + 1] = arr[x1][y2 + 1] - 1;
                arr[x2 + 1][y2 + 1] = arr[x2 + 1][y2 + 1] + 1;
            }
            for (int i = 1; i <= n; i++) {
                for (int j = 1; j <= n; j++) {
                    arr[i][j] = arr[i][j] + arr[i - 1][j] + arr[i][j - 1] - arr[i - 1][j - 1];
                    pw.print(arr[i][j] + " ");
                }
                pw.println();
            }
        });
    }
    public static void invoke(Consumer<PrintWriter> main) {
        PrintWriter printWriter = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
        main.accept(printWriter);
        printWriter.flush();
        printWriter.close();
    }
    static class Reader {
        static StreamTokenizer in = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));

        public static int nextInt() {
            try {
                in.nextToken();
            } catch (Exception ignored) {}
            return (int) in.nval;
        }
    }
}
